package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.domain.db.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

//用户详情
public interface UserInfoMapper extends BaseMapper<UserInfo> {
    //显示基本信息
    @Select("SELECT * FROM tb_user_info WHERE id=#{id}")
    UserInfo findUserSum(@Param("id") Long id);

    //冻结
    @Update("update tb_user_info set user_status = '2' where id =#{id}")
    void findUser(@Param("id") Long id);

    //解冻
    @Update("update tb_user_info set user_status = '1' where id =#{id}")
    void findUserupdate(@Param("id") Long id);

    @Select("SELECT id FROM tb_user WHERE phone=#{phone}")
    Long findId(@Param("phone") String phone);

    @Select("SELECT id FROM tb_user_info WHERE user_status='2'")
    List<Long> findStatus();


}